package com.csf.create.builder;

/**
 * TODO ADD DESCRIPTION
 * Date: 2018/9/6
 * Time: 14:14
 *
 * @author chenshf
 */
public class Message {

    private String name;
    private String title;
    private String content;

    public Message(Message.Builder builder) {
        this.name = builder.name;
        this.title = builder.title;
        this.content = builder.content;
    }


    public static Message.Builder builder(){
        return new Message.Builder();
    }

    public static class Builder{

        private String name;
        private String title;
        private String content;


        public Builder buildName(String name){
            this.name = name;
            return this;
        }

        public Builder buildTitle(String title){
            this.title = title;
            return this;
        }

        public Builder buildContent(String content){
            this.content = content;
            return this;
        }

        public Message build(){
            return new Message(this);
        }
    }

    @Override
    public String toString() {
        return "Message{" +
                "name='" + name + '\'' +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                '}';
    }
}
